package com.sohoometer.datamodify;


import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class JobImpl  implements Job{

	public void execute(JobExecutionContext context) throws JobExecutionException {
			try {
				String[] args = new String[3];
				DateFormat dateFormat = new SimpleDateFormat("[yyyy-MM-dd HH:mm:ss]");
				Date start = new Date();
				System.out.println(dateFormat.format(start)+"数据更新任务开始");
				Main.main(args);
				Date end = new Date();
				System.out.println(dateFormat.format(end)+"数据更新任务结束");
				long jobRunTime = context.getJobRunTime();
				System.out.println("一共用时"+jobRunTime+"毫秒");
				System.out.println("下次运行时间"+dateFormat.format(context.getNextFireTime()));
			} catch (Exception e) {
				System.err.println("程序有错误发生");
				e.printStackTrace();
			}
	}
}
